<?php /*a:3:{s:70:"D:\projects\original_admin\app\merchant\view\finance\finance_cash.html";i:1755332143;s:61:"D:\projects\original_admin\app\merchant\view\common\base.html";i:1752764603;s:63:"D:\projects\original_admin\app\merchant\view\common\header.html";i:1754830154;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8" />
	<meta name="renderer" content="webkit" />
	<meta name="force-rendering" content="webkit" />
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>管理系统</title>
	<script src="/static/merchant/js/jquery-min.js"></script>
	<link rel="stylesheet" href="/static/merchant/layui/css/layui.css">
	<script type="text/javascript" src="/static/merchant/layui/layui.js"></script>
	<link rel="stylesheet/less" type="text/css" href="/static/merchant/css/index.less" />
	<script src="/static/merchant/js/less.js"></script>
    
</head>
<body>
	<main class="CenterMain">
		<header class="Header">
    <div class="logo img_box">
        <img src="/static/merchant/images/logow.png">

    </div>
    <div class="top">
        <ul class="nav-buttons">
            <li id="toggle-btn">

                <span class="desktop-text layui-icon layui-icon-spread-left">
                </span>
                <span class="mobile-text">菜单</span>
            </li>
        </ul>
        <dl class="menu-btn">
            <a class="img_box ">
                <img src="/static/merchant/images/head1.png">
                <i class="msg"></i>
            </a>
            <a class="img_box">
                <img src="/static/merchant/images/head2.png">
            </a>
        </dl>
        <span class="hr"></span>
        <ul class="layui-nav">

            <li class="layui-nav-item" lay-unselect>
                <a href="javascript:;">
                    <img  src="<?php echo htmlentities((string) (isset($userInfo['shop_thumb']) && ($userInfo['shop_thumb'] !== '')?$userInfo['shop_thumb']:'/static/merchant/images/sign-user.png')); ?>" class="layui-nav-img">
                    <span><?php echo htmlentities((string) $userInfo['shop_name']); ?></span>
                </a>
                <dl class="layui-nav-child">
                    <!-- <dd><a href="account_info.html">个人信息</a></dd> -->
                    <dd><a href="/merchant/account_pwd.html">密码修改</a></dd>
                    <dd style="text-align: center;"><a href="/merchant/login_out">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

</header>
<div class="Sidebar" id="sidebar">
    <ul class="menu">
        <li class="menu-item">
            <div lay-on="url" href="/" class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav22.png">
                    <img class="img2" src="/static/merchant/images/nav21.png">
                </div>
                <span>商品管理</span>
                <!-- <i class="layui-icon layui-icon-right"></i> -->
            </div>
        </li>
        <li class="menu-item <?php if($routers == 'order/list' || $routers == 'order/shop_back' || $routers == 'order/review'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav32.png">
                    <img class="img2" src="/static/merchant/images/nav31.png">
                </div>
                <span>订单管理</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>
            <dl    <?php if($routers == 'order/list' || $routers == 'order/shop_back' || $routers == 'order/review'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?> >
                <dd>
                    <a href="/merchant/order.html"  <?php if($routers == 'order/list'): ?>  class="active" <?php endif; ?> >订单管理</a>
                </dd>
                <dd>
                    <a href="/merchant/shop_back.html" <?php if($routers == 'order/shop_back'): ?>  class="active" <?php endif; ?>>退货管理</a>
                </dd>
                <dd>
                    <a href="/merchant/review.html" <?php if($routers == 'order/review'): ?>  class="active" <?php endif; ?>>订单评价</a>
                </dd>

            </dl>

        </li>
        <li class="menu-item <?php if($routers == 'finance/finance_cash' || $routers == 'finance/finance_account' || $routers == 'finance/finance_log' || $routers == 'finance/finance_logs'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav42.png">
                    <img class="img2" src="/static/merchant/images/nav41.png">
                </div>
                <span>财务提现</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

            <dl  <?php if($routers == 'finance/finance_cash' || $routers == 'finance/finance_account' || $routers == 'finance/finance_log' || $routers == 'finance/finance_logs'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?>>
                <dd>
                    <a  <?php if($routers == 'finance/finance_cash'): ?>  class="active" <?php endif; ?> href="/merchant/finance_cash.html">提现</a>
                </dd>
                <dd>
                    <a  <?php if($routers == 'finance/finance_logs'): ?>  class="active" <?php endif; ?> href="/merchant/finance_logs.html">记录</a>
                </dd>
            </dl>

        </li>
        <!-- <li class="menu-item ">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="images/nav52.png">
                    <img class="img2" src="images/nav51.png">
                </div>
                <span>消息中心</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

        </li> -->
        <li class="menu-item <?php if($routers == 'store/store_info' || $routers == 'store/store_notice' || $routers == 'store/store_model'): ?>  active <?php endif; ?>">
            <div class="title">
                <div class="img img_box">
                    <img class="img1" src="/static/merchant/images/nav62.png">
                    <img class="img2" src="/static/merchant/images/nav61.png">
                </div>
                <span>店铺设置</span>
                <i class="layui-icon layui-icon-right"></i>
            </div>

            <dl <?php if($routers == 'store/store_info' || $routers == 'store/store_notice' || $routers == 'store/store_model'): ?>  style="display: block;" <?php else: ?> style="display:none;" <?php endif; ?>>
                <dd>
                    <a  <?php if($routers == 'store/store_info'): ?>  class="active" <?php endif; ?> href="/merchant/store_info.html">店铺信息 </a>
                </dd>
                <dd>
                    <a <?php if($routers == 'store/store_notice'): ?>  class="active" <?php endif; ?> href="/merchant/store_notice.html">店铺公告</a>
                </dd>
                <dd>
                    <a <?php if($routers == 'store/store_model'): ?>  class="active" <?php endif; ?>  href="/merchant/store_model.html">运费模板</a>
                </dd>
            </dl>

        </li>
    </ul>
</div>
		 
<div class="Content" id="content">
    <div class="container">
        <div class="cashNav">
            <a class="item active" href="finance_cash.html">提现</a>
            <a class="item " href="finance_log.html">提现记录</a>
            <a class="item " href="finance_account.html">提现账户</a>
        </div>

        <div class="CashPage">
            <ul class="info">
                <li>
                    总可提现：<b>¥<?php echo htmlentities((string) (isset($merchant['balance']) && ($merchant['balance'] !== '')?$merchant['balance']:0)); ?></b>
                </li>
                <li>
                    待结算金额：<b>¥<?php echo htmlentities((string) (isset($merchant['amount']) && ($merchant['amount'] !== '')?$merchant['amount']:0)); ?></b>
                </li>
            </ul>
            <div class="text">
                <p class="tag">提现规则：(可提现金额须≥¥100，每天最多提现3次)</p>
                <?php if(!$merchant_account_exits): ?> 
                    <p class="tag">您还没有设置提现账号，<a class="red" href="/merchant/finance_account.html">去设置>> </a></p>
                <?php endif; ?>
            </div>

            <div class="content">
                <div class="FormPage">
                    <form class="layui-form" lay-filter="withdrawForm">
                        <div class="form-item-inline">
                            <label class="must form-label">提现金额：</label>
                            <div class="input-inline">
                                <input type="number" name="amount" min="100" class="layui-input"
                                    placeholder="请输入提现金额" lay-verify="required|number|amountCheck">
                                <p class="layui-form-mid layui-word-aux">最小提现金额100元</p>
                            </div>
                        </div>
                        
                        <div class="form-item-inline">
                            <label class="form-label">收款人：</label>
                            <div class="input-inline">
                                <?php echo htmlentities((string) (isset($merchant_account['account_user']) && ($merchant_account['account_user'] !== '')?$merchant_account['account_user']:'未设置')); ?>
                                <input type="hidden" name="account_user" value="<?php echo htmlentities((string) (isset($merchant_account['account_user']) && ($merchant_account['account_user'] !== '')?$merchant_account['account_user']:'')); ?>">
                            </div>
                        </div>
                        
                        <!-- <div class="form-item-inline">
                            <label class="form-label">银行卡号：</label>
                            <div class="input-inline">
                                <?php echo htmlentities((string) (isset($merchant_account['account']) && ($merchant_account['account'] !== '')?$merchant_account['account']:'未设置')); ?>
                                <input type="hidden" name="account" value="<?php echo htmlentities((string) (isset($merchant_account['account']) && ($merchant_account['account'] !== '')?$merchant_account['account']:'')); ?>">
                            </div>
                        </div> -->
                        
                        <div class="form-item-inline">
                            <label class="must form-label">交易密码：</label>
                            <div class="input-inline">
                                <input type="password" name="trade_password" class="layui-input"
                                    placeholder="请输入交易密码" lay-verify="required">
                                <a class="red" id="forgetPassword" style="margin-left: 10px;">忘记交易密码？</a>
                            </div>
                        </div>

                        <div class="form-item-inline">
                            <label class="form-label"></label>
                            <div class="input-inline foot">
                                <button class="layui-btn" lay-submit lay-filter="submitWithdraw">确认提现</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

            <div class="tips">
                <b>说明</b>
                <p>1.企业服务方提现需先向平台提供发票后解锁金额(发票开出后，请提交发票已开出提醒，通知平台解锁)，发票抬头请见服务费页面底部<br>
                    2.充值金额不能提现，可提现金额来自您的收入。</p>
            </div>
        </div>
    </div>
</div>

	</main>
</body>
<script  src="/static/merchant/js/index.js"></script>
<script src="/static/merchant/js/base.js"></script>
 
<script>
    changeTitleName('提现');
    
    layui.use(['form', 'layer', 'jquery'], function(){
        var form = layui.form;
        var layer = layui.layer;
        var $ = layui.jquery;
        
        // 自定义验证规则
        form.verify({
            amountCheck: function(value){
                var balance = parseFloat("<?php echo htmlentities((string) (isset($merchant['balance']) && ($merchant['balance'] !== '')?$merchant['balance']:0)); ?>");
                value = parseFloat(value);
                
                if(value < 100){
                    return '提现金额不能少于100元';
                }
                
                if(value > balance){
                    return '提现金额不能超过可提现余额';
                }
                
                // 可以添加每日提现次数限制的检查
            }
        });
        
        // 忘记密码点击事件
        $('#forgetPassword').on('click', function(){
            layer.open({
                type: 2,
                title: '找回交易密码',
                area: ['500px', '400px'],
                content: '/merchant/reset_transaction_password.html'
            });
        });
        
        // 表单提交
        form.on('submit(submitWithdraw)', function(data){
            // 检查是否设置了提现账户
            <?php if(!$merchant_account_exits): ?>
                layer.msg('请先设置提现账户', {icon: 2});
                return false;
            <?php endif; ?>
            
            var loading = layer.load(2);
            
            $.ajax({
                url: '/merchant/withdraw_apply',
                type: 'POST',
                dataType: 'json',
                data: data.field,
                success: function(res){
                    layer.close(loading);
                    if(res.code === 200){
                        layer.msg('提现申请已提交', {icon: 1});
                        // 可以刷新页面或跳转到提现记录
                        setTimeout(function(){
                            location.href = '/merchant/finance_log.html';
                        }, 1500);
                    }else{
                        layer.msg(res.msg || '提现申请失败', {icon: 2});
                    }
                },
                error: function(){
                    layer.close(loading);
                    layer.msg('网络错误，请稍后再试', {icon: 2});
                }
            });
            
            return false;
        });
    });
</script>
>
</html>